package com.wei.czz.common.vo.blog;

import com.wei.czz.common.constant.RedisConstant;
import com.wei.czz.common.jsr303.group.OrderSearch;
import com.wei.czz.common.jsr303.group.Search;
import com.wei.czz.common.vo.common.BaseVo;
import lombok.*;

import javax.validation.constraints.NotNull;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2021-05-26 16:37:00
 * className: IndexVo 浏览器页面-首页面-检索Vo类
 * version: 1.0
 * description:
 */
@Getter
@Setter
public class IndexVo extends BaseVo {

    /**
     * 博客列表排序类型[0-最新 1-浏览最多 2-点赞最多]
     */
    @NotNull(message = "博客排序方式不能为空", groups = { Search.class, OrderSearch.class })
    private Integer sortType;

    /**
     * 获取Redis-String缓存键
     */
    public String getIndexListKey() {
        return RedisConstant.INDEX_LIST + RedisConstant.SPLIT + word + RedisConstant.SPLIT + sortType
                + RedisConstant.SPLIT + page + RedisConstant.SPLIT + limit;
    }

}
